#pragma once


class XmlTreeNode : public ui::TreeNode
{
public:
	virtual void OnClickItem() override;
	virtual void SetExpand(bool bExpand) override;
};

class Canvas;
class XmlTree : public ui::TreeView
{
public:
	XmlTree();
	virtual ~XmlTree();
	void InitTree(Canvas *canvas);
	
	bool InsertControl(Box* box, Control *control);

	ui::TreeNode *FindNodeByDataId(std::string id);
	ui::TreeNode *FindNodeByDataId(ui::TreeNode *parentNode, std::string id);
private:
	Canvas *m_pCanvas;
	ui::TreeNode *m_pRootBox{ nullptr };
};

